<template>
  <div class="background-container">
    <img src="../assets/svg/login/background.svg" alt="Background" class="wave" />
  </div>
  <div class="login-page">
    <div class="logo-container">
      <img src="../assets/logo2.png" alt="Logo" class="logo" />
    </div>
    <div class="login-container">
      <div class="illustration">
        <img src="../assets/svg/login/pic1.svg" alt="Illustration" />
      </div>
      <div class="form-container">
        <h2>登录</h2>
        <form @submit.prevent="handleSubmit">
          <div class="input-group">
            <input type="email" placeholder="电子邮箱" v-model="email" required />
            <i class="fas fa-envelope"></i>
          </div>
          <div class="input-group">
            <input type="password" placeholder="密码" v-model="password" required />
            <i class="fas fa-eye"></i>
            <a href="#" class="forgot-password">忘记密码?</a>
          </div>
          <button type="submit" class="login-button">登录</button>
        </form>
        <p class="register-text">没有账号，立即注册?</p>
        <button @click="register" class="register-button">注册</button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      email: '',
      password: ''
    }
  },
  methods: {
    handleSubmit () {
      console.log('Email:', this.email)
      console.log('Password:', this.password)
    },
    register () {
      console.log('注册')
    }
  }
}
</script>
<style>
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

.logo-container {
  position: absolute;
  top: 20px;
  display: flex;
  gap: 10px;
  z-index: 1;
  margin-right: 1050px;
}

.logo-container h2 {
  color: #3A8FE6;
}

.logo {
  max-width: 180px;
  height: auto;
}

.login-page {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}

.background-container {
  position: absolute;
  top: 0;
  left: -960px;
  width: 100%;
  height: 100%;
  background: white;
  z-index: -1;
  backdrop-filter: blur(20px);
}
.wave {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.login-container {
  display: flex;
  width: 900px;
  height: 550px;
  background: rgba(255, 255, 255, 0.042);
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  margin-left: 120px;
}
.login-container::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  height: 100%;
  backdrop-filter: blur(10px);
  z-index: -1;
}

.illustration {
  padding: 40px;
}

.illustration img {
  max-width: 100%;
  height: auto;
}

.form-container {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h2 {
  margin-bottom: 20px;
  margin-left: 160px;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group input {
  width: 100%;
  padding: 10px 40px 10px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.input-group i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.forgot-password {
  position: absolute;
  right: 10px;
  bottom: -20px;
  font-size: 12px;
  color: #007BFF;
  text-decoration: none;
}

.login-button,
.register-button {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.login-button {
  background: #3A8FE6;
  color: white;
  border-radius: 24px;
}

.register-button {
  background: none;
  color: #007BFF;
  border: 1px solid #007BFF;
  border-radius: 24px;
}

.register-text {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #828282;
}

@media (max-width: 768px) {
  .login-container {
    width: 90%;
    flex-direction: column;
    border-radius: 0;
  }

  .illustration, .form-container {
    width: 100%;
  }
}
</style>
